package com.compass.mobile.ui.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.mobile.databinding.LayoutImgItemBinding
import com.compass.mobile.databinding.LayoutItemInspectionBinding
import com.compass.mobile.framework.adapter.BaseBindViewHolder
import com.compass.mobile.framework.adapter.BaseRecyclerViewAdapter
import com.compass.mobile.framework.utils.BigDecimalUtils
import com.compass.mobile.models.ProjectRespVOS

/**
 * Description：
 * Date:2024/6/20 22:15
 */
class InspectionItemAdapter :
    BaseRecyclerViewAdapter<ProjectRespVOS, LayoutItemInspectionBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutItemInspectionBinding>,
        item: ProjectRespVOS?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvName.text = item.inspectionName
            tvPrice.text = "￥${BigDecimalUtils.divide(item.price)}元"
        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutItemInspectionBinding {
        return LayoutItemInspectionBinding.inflate(layoutInflater, parent, false)
    }
}